package com.vf.admin.miaodong.service.impl;


import cn.hutool.core.util.ObjectUtil;
import com.vf.admin.miaodong.dao.AfterAppActiveDao;
import com.vf.admin.miaodong.entity.AppActive;
import com.vf.admin.miaodong.service.AfterAppActiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/8/11 10:28
 */
@Service
public class AfterAppActiveServiceImpl implements AfterAppActiveService {

    @Autowired
    AfterAppActiveDao afterAppActiveDao;

    @Override
    public void saveAppActiveNumCount(AppActive param) {


        afterAppActiveDao.saveOrUpdate(param);

    }

    @Override
    public Integer countAppActive(Map<String, Object> map) {



        List<AppActive> appActives = afterAppActiveDao.countAppActive(map);
        if (ObjectUtil.isNotEmpty(appActives)){
            return appActives.get(0).getNum();
        }else {
            return 0;
        }


    }


}
